import os
import subprocess

import pytest


if __name__ == '__main__':
    pytest.main()
    #生成静态文件的报告
    os.system("allure generate reports/templs -o  reports/allures --clean")
    #制定端端口号启动allure服务访问
    #os.system("allure serve reports/temp -p 8080")
    # os.system("/usr/google/allure-2.29.0/bin/allure serve report/temps -p 8080")
    #liux、mac、windows系统用过启动allure后台运行
    command = ["allure", "serve", "reports/temp", "-p", "8080"]
    # command1 = ["/usr/google/allure-2.29.0/bin/allure", "serve", "reports/temp", "-p", "8080"]
    process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    #手动杀死allure服务命令窗口执行的命令
    # pkill -f "allure"



